import { requestClient } from '#/api/request';

export namespace LogApi {
  export interface PageFetchParams {
    [key: string]: any;
    page: number;
    pageSize: number;
    search?: string;
  }
}

/**
 * 获取日志列表
 */
export async function getLogsApi(params: LogApi.PageFetchParams) {
  return requestClient.get('/audit/logs/list', { params });
}

/**
 * 删除日志
 */
export async function deleteLogById(id: string) {
  try {
    return requestClient.delete(`/audit/logs/delete?id=${id}`);
  } catch (error) {
    console.error('删除日志失败:', error);
    throw error;
  }
}
